<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ include file="/resource/common.jsp"%> 
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<%--应用系统访问资源新增--%>
		<title>${title}</title>
		<meta http-equiv="cache-control" content="no-cache"/>
		<meta http-equiv="expires" content="0"/>    
		<script type="text/javascript">
			$(function(){
				$("body").css({visibility:"visible"});
				if("${data.resid}"!=""){
					$("#url").attr("readonly","readonly");
					$("#url").css("background-color","#CDC5BF")
				}
			});
			
			
			
			
			/**表单提交*/
			function saveSysResource(pageIndex){
				if($("#query_form").form('validate'))
				{
					top.mask();
					$("#query_form").ajaxSubmit({
						url:parent.formateUrl("sys/resource/create.json"),
						type:"post",
						dataType:"json",
						success:function(data){
												
							if("1" == data.msg.status){
								top.showMsg(data.msg.body);
								top.refresh('afterSave');
							}
						},
						error:function(){
							top.unmask();
						}
					});
				}
			}
		</script>
	</head>
<body style="margin:0px;padding:0px;" >
		<div >
	    	<form action="sys/resource/create.json" id="query_form" style="padding:0px;margin:0px;width：350px;">
		    		<table style="padding:0px;margin:0px;width：350px;">
		    			<tr>
		    				<td  class="td_label"   >资源名称:</td>
		    				<td>
		    					<input class="easyui-validatebox" data-options='required:true,tipPosition:"bottom",missingMessage:"请输入资源名称"' 
		    					style="border:1px solid #ccc;" id="name" type="text" name="name" value="${data.name}" maxlength="25" onblur="this.value=this.value.replace(/\s/g,'');"/>
		    					<input type="hidden" name="resid" value="${data.resid}"/>
		    				</td>
		    			</tr>
		    			<tr>
		    				<td  class="td_label">访问URL:</td>
		    				<td><input id="url"  style="border:1px solid #ccc;" value="${data.url }" type="text" name="url" maxlength="100" onblur="this.value=this.value.replace(/\s/g,'');"/></td>
		    			</tr>
		    			<tr>
		    				<td  class="td_label">备注信息:</td>
		    				<td><input id="remark" style="border:1px solid #ccc;" type="text" name="remark" value="${data.remark}" maxlength="25" onblur="this.value=this.value.replace(/\s/g,'');"/></td>
		    			</tr>
		    			<tr>
		    				<td  class="td_label">系统排序:</td>
		    				<td><input id="ordernum" class="easyui-numberbox" data-options='required:true,tipPosition:"bottom",missingMessage:"请输入数字"' style="border:1px solid #ccc;" type="text" name="ordernum" value="${0 == data.ordernum ? '' :data.ordernum}" onblur="this.value=this.value.replace(/[^0-9]/g,'');" maxlength="5"/></td>
		    			</tr>
		    			<tr>
		    				<td  class="td_label" >资源所属:</td>
		    				<td>
		    					<select name="parent_id" style="width:150px;border: 0" class="easyui-combobox" data-options='required:true,tipPosition:"bottom",missingMessage:"请选择",panelHeight:"70px",editable:false'>
		    						<option value="5" ${'5' eq data.parent_id ? 'selected=selected':''}>系统管理</option>
		    						<option value="6" ${'6' eq data.parent_id ? 'selected=selected':''}>日志管理</option>
		    					</select>
		    				</td>
		    			</tr>
		    		</table>
	    	</form>
	    </div>
	</body>
</html>
